package com.mifengs.mall.netWork.api;

import com.mifengs.mall.Constant;
import com.mifengs.mall.entity.FloorResponseBean;
import com.mifengs.mall.entity.HomeData;
import com.mifengs.mall.entity.HomeResponseBean;
import com.mifengs.mall.entity.ResponseBean;
import com.mifengs.mall.entity.ResponseInfo;
import com.mifengs.mall.entity.SplashBean;
import com.mifengs.mall.entity.SplashResponseBean;
import com.mifengs.mall.entity.StoreApplyInfo;
import com.mifengs.mall.entity.UpgradeInfo;

import java.util.ArrayList;
import java.util.Map;

import okhttp3.ResponseBody;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import rx.Observable;

/**
 * Created by lihaoqi on 2017/11/3.
 */

public interface HomeDataApi {

    @GET(Constant.HOME_DATA)
    Observable<ResponseInfo<HomeData>> getData(
    );

    @FormUrlEncoded
    @POST(Constant.STORE_APPLY_PROGRESS)
    Observable<ResponseBean<StoreApplyInfo>> getApplyProgress(
            @FieldMap Map<String, String> map
    );


    @GET(Constant.GET_PHOTO_PATH)
    Observable<ResponseInfo<String>> getPhotoPath();

    @Headers("InterVersion:V_01_01")
    @GET(Constant.GETHOME_DATA)
//    @GET("http://192.168.0.132:8081/mIndex.do")
    Observable<ResponseBean<HomeResponseBean>> getHomeData();

    @Headers("InterVersion:V_01_01")
    @FormUrlEncoded
    //@POST("http://192.168.1.233:8081/queryFloors.do")
    @POST(Constant.GET_FLOORS)
    Observable<ResponseBean<FloorResponseBean>> getFloors(
            @FieldMap Map<String, String> map
    );

    @Headers("InterVersion:V_01_01")

    @FormUrlEncoded
    @POST(Constant.GET_LIKES_GOODS)
    Observable<ResponseBean<FloorResponseBean>> getLikeGoods(
            @FieldMap Map<String, String> map
    );

//    @Headers("InterVersion:V_01_01")
    @Headers("Content-Type:application/x-www-form-urlencoded;charset=UTF-8")
    @FormUrlEncoded
    @POST(Constant.SAVECONTACTS)
    Observable<ResponseBody> updateContact(
            @FieldMap Map<String, String> map
    );


    @Headers("InterVersion:V_01_01")
    @GET(Constant.SPLASH_INFO)
    Observable<ResponseBean<SplashResponseBean>> getSplashScreen();

    @Headers("InterVersion:V_01_01")
    @GET(Constant.UPGRADEINFO)
    Observable<ResponseBean<UpgradeInfo>> getUpgradeInfo();



}
